﻿@model IEnumerable<Citi.Scheduler.WebUi.Models.RoutineExecutionModel>
@{
    Layout = null;
}
<html>
<head>
    <title>Dashboard - @ViewBag.CategoryName</title>
</head>
<body>
    <p>
        Dear @ViewBag.UserName,
    </p>
    <p>
        This is your scheduled report that shows the routines status in the category @ViewBag.CategoryName
    </p>
    <p>
        Below follows the dashboard:
    </p>
    @*@Html.Partial("~/Views/RoutineExecution/DashboardRoutines.cshtml", Model)*@
    <table>
        <tr>
            <th>
                Routine Name
            </th>
            <th>
                Category
            </th>
            <th>
                Scheduled Time
            </th>
            <th>
                Ended On
            </th>
            <th>
                Responsible
            </th>
            <th>
                Status
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.Routine.Name
                </td>
                <td>
                    @item.Routine.Category.Name
                </td>
                <td>@item.ScheduledDateTime.ToString("HH:mm MM/dd/yyyy")
                </td>
                <td>@(item.EndsOn.HasValue ? item.EndsOn.Value.ToString("HH:mm MM/dd/yyyy") : string.Empty)
                </td>
                <td>
                    @item.Routine.User.Name
                </td>
                <td>
                    <img src="@Url.Content(string.Format("~/Content/Images/RoutineExecutionStatus/{0}.png", item.Status))" style="width:20px" alt="@item.Status.GetDescription()" />
                </td>
            </tr>
        }
    </table>
</body>
</html>
